/*
Wolke Lin 
blog:http://wolkesau.pixnet.net/blog
email:wolkesau@gmail.com
=========================
curl msg board 
bug:
1.need to check the final word
2.repeat is not good
2009.1126*/
$.fn.WL_doStrangeMsgBoard=function(repJSON){
				window.g__DoMsg=function (id)
				{
					obj=$('#'+id);					
					var index=repJSON['str'].length;
					if($(obj).val().length>repJSON['limit_char'])
					{
						while(true)
						{	
							var chk_word=repJSON['str'].substr(0,index);
		
							if($(obj).val().search(repJSON['str'])>=0)
							{
								$(obj).val($(obj).val()+repJson['repeat']);
								break;
							}
							else				
							{
								if($(obj).val().search(chk_word)>=0)
								{							
									$(obj).val($(obj).val()+repJSON['str'].substr(chk_word.length,1));
									break;
								}
								if(index==0)
								{
									$(this).val($(this).val()+repJSON['str'].substr(chk_word.length,1));
									break;
								}					
							}
							index-=1;
						}	
					}
				}
			return this.each(function(){			

				setInterval('g__DoMsg("'+$(this).attr('id')+'")',repJSON['limit_char']);
			});
		}
